import 'dart:convert';
// 用户的书单

class BookList {
  int id;
  String name;
  String instruction;
  bool publish;
  DateTime publishTime;

  static List<BookList> fromJson(dynamic data) {
    List<BookList> _list = [];

    data.forEach((o) {
      BookList bookList = BookList();
      bookList.id = o["id"];
      bookList.name = o["name"];
      bookList.instruction = o["instruction"];
      bookList.publishTime = DateTime.parse(o["publish_time"]);
      bookList.publish = o["publish"];
      _list.add(bookList);
    });

    return _list;
  }

  @override
  String toString() {
    return 'BookList{id: $id, name: $name, instruction: $instruction, publish: $publish, publishTime: $publishTime}';
  }
}
